{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Accuracy', 'BackupAndRestore', 'BleuScore', 'COOTensor', 'CSRTensor', 'Callback', 'CheckpointConfig', 'Cifar100ToMR', 'Cifar10ToMR', 'ConfusionMatrix', 'ConfusionMatrixMetric', 'ConvertModelUtils', 'ConvertNetUtils', 'CosineSimilarity', 'CsvToMR', 'DatasetHelper', 'Dice', 'DynamicLossScaleManager', 'EarlyStopping', 'EnvProfiler', 'F1', 'FAILED', 'Fbeta', 'FileReader', 'FileWriter', 'FixedLossScaleManager', 'GRAPH_MODE', 'HausdorffDistance', 'History', 'ImageNetToMR', 'Int', 'JitConfig', 'LambdaCallback', 'LearningRateScheduler', 'Loss', 'LossMonitor', 'LossScaleManager', 'MAE', 'MSE', 'MeanSurfaceDistance', 'Metric', 'MindPage', 'MnistToMR', 'Model', 'ModelCheckpoint', 'Node', 'NodeType', 'OcclusionSensitivity', 'OnRequestExit', 'PYNATIVE_MODE', 'ParallelMode', 'Parameter', 'ParameterTuple', 'Perplexity', 'Precision', 'Profiler', 'QuantDtype', 'ROC', 'Recall', 'ReduceLROnPlateau', 'RootMeanSquareDistance', 'RowTensor', 'RunContext', 'SUCCESS', 'ScopedValue', 'SparseTensor', 'SummaryCollector', 'SummaryLandscape', 'SummaryRecord', 'SymbolTree', 'TFRecordToMR', 'Tensor', 'TimeMonitor', 'Top1CategoricalAccuracy', 'Top5CategoricalAccuracy', 'TopKCategoricalAccuracy', 'TreeNodeHelper', 'Type', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_c_dataengine', '_c_expression', '_c_mindrecord', '_check_jit_forbidden_api', '_checkparam', '_extends', '_null', '_null_type', '_op_impl', 'absolute_import', 'amp', 'async_ckpt_thread_status', 'auc', 'bool_', 'boost', 'build_searched_strategy', 'build_train_network', 'byte', 'common', 'communication', 'complex128', 'complex64', 'connect_network_with_dataset', 'context', 'convert_model', 'data_sink', 'dataset', 'default_config', 'double', 'dtype', 'dtype_to_nptype', 'dtype_to_pytype', 'experimental', 'export', 'float16', 'float32', 'float64', 'float_', 'get_algo_parameters', 'get_auto_parallel_context', 'get_context', 'get_grad', 'get_level', 'get_log_config', 'get_metric_fn', 'get_obj_module_and_name_info', 'get_ps_context', 'get_py_obj_dtype', 'get_seed', 'grad', 'half', 'int16', 'int32', 'int64', 'int8', 'int_', 'intc', 'intp', 'is_invalid_or_jit_forbidden_method', 'is_jit_forbidden_module', 'jacfwd', 'jacrev', 'jit', 'jit_class', 'jvp', 'list_', 'load', 'load_checkpoint', 'load_distributed_checkpoint', 'load_param_into_net', 'log', 'merge_pipeline_strategys', 'merge_sliced_parameter', 'mindrecord', 'ms_class', 'ms_function', 'ms_memory_recycle', 'mutable', 'names', 'nn', 'number', 'numpy', 'obfuscate_model', 'ops', 'parallel', 'parse_print', 'profiler', 'pytype_to_dtype', 'rank_list_for_transform', 'rearrange_inputs', 'reset_algo_parameters', 'reset_auto_parallel_context', 'reset_ps_context', 'restore_group_info_list', 'rewrite', 'run_check', 'save_checkpoint', 'set_algo_parameters', 'set_auto_parallel_context', 'set_context', 'set_dump', 'set_ps_context', 'set_seed', 'shard', 'short', 'single', 'string', 'tensor', 'tensor_type', 'train', 'transform_checkpoint_by_rank', 'transform_checkpoints', 'tuple_', 'type_none', 'ubyte', 'uint', 'uint16', 'uint32', 'uint64', 'uint8', 'uintc', 'uintp', 'ushort', 'value_and_grad', 'version', 'vjp', 'vmap']\n"
     ]
    }
   ],
   "source": [
    "import mindspore\n",
    "\n",
    "print(dir(mindspore))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function ones in module mindspore.ops.function.array_func:\n",
      "\n",
      "ones(shape, dtype=None)\n",
      "    Creates a tensor filled with value ones.\n",
      "    \n",
      "    Creates a tensor with shape described by the first argument and fills it with value ones in type of the second\n",
      "    argument.\n",
      "    \n",
      "    Args:\n",
      "        shape (Union[tuple[int], int]): The specified shape of output tensor. Only constant positive int is allowed.\n",
      "        dtype (:class:`mindspore.dtype`): The specified type of output tensor. If `dtype` is None,\n",
      "            `mindspore.float32` will be used. Default: None.\n",
      "    \n",
      "    Returns:\n",
      "        Tensor, has the same type and shape as input shape value.\n",
      "    \n",
      "    Raises:\n",
      "        TypeError: If `shape` is neither tuple nor int.\n",
      "    \n",
      "    Supported Platforms:\n",
      "        ``Ascend`` ``GPU`` ``CPU``\n",
      "    \n",
      "    Examples:\n",
      "        >>> output = ops.ones((2, 2), mindspore.float32)\n",
      "        >>> print(output)\n",
      "        [[1. 1.]\n",
      "         [1. 1.]]\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import mindspore.ops as ops\n",
    "help(ops.ones)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Tensor(shape=[4], dtype=Float32, value= [ 1.00000000e+00,  1.00000000e+00,  1.00000000e+00,  1.00000000e+00])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ops.ones(4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "MindSpore",
   "language": "python",
   "name": "mindspore"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
